<?php

namespace app\common\behavior;

use app\common\logic\CacheKey;

/**
 * INIT
 * Class InitHook
 * @package app\common\behavior
 */
class InitHook
{

    public function run()
    {

        //初始化某些配置信息
        if (cache(CacheKey::DB_CONFIG_DATA)) {
            \think\Config::set(cache(CacheKey::DB_CONFIG_DATA));
        } else {
            $config = model('common/Config');
            \think\Config::set($config->lists());
        }

        //扩展插件
        \think\Loader::addNamespace('addons', ROOT_PATH . '/addons/');

    }
}